<!DOCTYPE html>


  <html class="dark page-post">


<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>React Native之Icon/启动图设置 | Poetry&#39;s Blog</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
    <meta name="keywords" content="react,RN,">
  

  <meta name="description" content="生成不同尺寸的启动图和图标方式一  借助Ionic生成不同尺寸的启动图和图标  方式二 各种尺寸Icon图标生成  使用图标工厂生成 https://icon.wuruihong.com/   安卓下替换andriod/app/src/main/res/下的mipmap文件即可 iOS下替换如下   各种尺寸启动图图标生成  启动图也可以使用图标工厂生产了 https://icon.wuruiho">
<meta name="keywords" content="react,RN">
<meta property="og:type" content="article">
<meta property="og:title" content="React Native之Icon&#x2F;启动图设置">
<meta property="og:url" content="http://blog.poetries.top/2019/10/04/rn-icon-spash-setting/index.html">
<meta property="og:site_name" content="Poetry&#39;s Blog">
<meta property="og:description" content="生成不同尺寸的启动图和图标方式一  借助Ionic生成不同尺寸的启动图和图标  方式二 各种尺寸Icon图标生成  使用图标工厂生成 https://icon.wuruihong.com/   安卓下替换andriod/app/src/main/res/下的mipmap文件即可 iOS下替换如下   各种尺寸启动图图标生成  启动图也可以使用图标工厂生产了 https://icon.wuruiho">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/750.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/751.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/750.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/752.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/753.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/540.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/541.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/744.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/745.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/746.webp">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/747.webp">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/754.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/755.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/748.webp">
<meta property="og:updated_time" content="2020-08-15T04:25:31.934Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="React Native之Icon&#x2F;启动图设置">
<meta name="twitter:description" content="生成不同尺寸的启动图和图标方式一  借助Ionic生成不同尺寸的启动图和图标  方式二 各种尺寸Icon图标生成  使用图标工厂生成 https://icon.wuruihong.com/   安卓下替换andriod/app/src/main/res/下的mipmap文件即可 iOS下替换如下   各种尺寸启动图图标生成  启动图也可以使用图标工厂生产了 https://icon.wuruiho">
<meta name="twitter:image" content="https://poetries1.gitee.io/img-repo/2019/10/750.png">

  

  
    <link rel="icon" href="/favicon.ico">
  

  <link href="/css/styles.css?v=c114cbeddx" rel="stylesheet">
<link href="/css/other.css?v=c114cbeddx" rel="stylesheet">


  
    <link rel="stylesheet" href="/css/personal-style.css">
  

  

  
  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?40b1f89aa80f2527b3db779c6898c879";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>


  
  <script type="text/javascript">
	(function(){
	    var bp = document.createElement('script');
	    var curProtocol = window.location.protocol.split(':')[0];
	    if (curProtocol === 'https') {
	        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
	    }
	    else {
	        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
	    }
	    var s = document.getElementsByTagName("script")[0];
	    s.parentNode.insertBefore(bp, s);
	})();
  </script>



  
    <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css">
  

  <!-- 聊天系统 -->
  
    
   <link type="text/css" rel="stylesheet" href="/renxi/default.css">
   <style>
      #modal {
        position: static !important;
      }
      .filter {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: #fe5757;
        animation: colorChange 30s ease-in-out infinite;
        animation-fill-mode: both;
        mix-blend-mode: overlay;
      }
  
      @keyframes colorChange {
        0%, 100% {
            opacity: 0;
        }
        50% {
            opacity: .9;
        }
      }
   </style>
</head>
</html>
<body>
  
  
    <span id="toolbox-mobile" class="toolbox-mobile">导航</span>
  

  <div class="post-header CENTER">
   
  <div class="toolbox">
    <a class="toolbox-entry" href="/">
      <span class="toolbox-entry-text">导航</span>
      <i class="icon-angle-down"></i>
      <i class="icon-home"></i>
    </a>
    <ul class="list-toolbox">
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/archives/"
            rel="noopener noreferrer"
            target="_self"
            >
            博客
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/categories/"
            rel="noopener noreferrer"
            target="_self"
            >
            分类
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/tags/"
            rel="noopener noreferrer"
            target="_self"
            >
            标签
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/search/"
            rel="noopener noreferrer"
            target="_self"
            >
            搜索
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/link/"
            rel="noopener noreferrer"
            target="_self"
            >
            友链
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/about/"
            rel="noopener noreferrer"
            target="_self"
            >
            关于
          </a>
        </li>
      
    </ul>
  </div>


</div>


  <div id="toc" class="toc-article">
    <strong class="toc-title">文章目录<i class="iconfont toc-title" style="display:inline-block;color:#87998d;width:20px;height:20px;">&#xf004b;</i></strong>
    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#生成不同尺寸的启动图和图标"><span class="toc-text">生成不同尺寸的启动图和图标</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#安卓端"><span class="toc-text">安卓端</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#iOS端"><span class="toc-text">iOS端</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#添加启动页"><span class="toc-text">添加启动页</span></a></li></ol>
  </div>
  




<div class="content content-post CENTER">
   <!-- canvas 彩带 -->
<canvas id="evanyou" width="1302" height="678" style="position: fixed;width: 100%;height: 100%;top: 0;left:0;z-index:-1;"></canvas>

<article id="post-rn-icon-spash-setting" class="article article-type-post" itemprop="blogPost">
  <header class="article-header" style="position:relative;">
    <h1 class="post-title">React Native之Icon/启动图设置</h1>

    <div class="article-meta">
      <span>
        <i class="icon-calendar"></i>
        <span>2019.10.04</span>
      </span>

      
        <span class="article-author">
          <i class="icon-user"></i>
          <span>Poetry</span>
        </span>
      

      
  <span class="article-category">
    <i class="icon-list"></i>
    <a class="article-category-link" href="/categories/Front-End/">Front-End</a>
  </span>



      

      
      <i class="fa fa-eye"></i> 
        <span id="busuanzi_container_page_pv">
           &nbsp热度 <span id="busuanzi_value_page_pv">
           <i class="fa fa-spinner fa-spin"></i></span>℃
        </span>
      
      
       
          <span class="post-count">
            <i class="fa fa-file-word-o"></i>&nbsp
            <span>字数统计 1k字</span>
          </span>

          <span class="post-count">
            <i class="fa fa-columns"></i>&nbsp
            <span>阅读时长 4分</span>
          </span>
      
      
    </div>

    <i class="iconfont" id="toc-eye" style="display:inline-block;color:#b36619;position:absolute;top:0;right:0;cursor:pointer;
    font-size: 24px;">&#xe61c;</i>

  </header>

  <div class="article-content">
    
      <div id="container">
        <h2 id="生成不同尺寸的启动图和图标"><a href="#生成不同尺寸的启动图和图标" class="headerlink" title="生成不同尺寸的启动图和图标"></a>生成不同尺寸的启动图和图标</h2><p><strong>方式一</strong></p>
<blockquote>
<p><a href="http://blog.poetries.top/2019/01/10/ionic3-summary/#12-1-%E5%9B%BE%E6%A0%87%E7%94%9F%E6%88%90">借助Ionic生成不同尺寸的启动图和图标</a></p>
</blockquote>
<p><strong>方式二</strong></p>
<p><strong>各种尺寸Icon图标生成</strong></p>
<blockquote>
<p>使用图标工厂生成 <a href="https://icon.wuruihong.com/" target="_blank" rel="noopener">https://icon.wuruihong.com/</a></p>
</blockquote>
<ol>
<li>安卓下替换<code>andriod/app/src/main/res/</code>下的mipmap文件即可</li>
<li>iOS下替换如下</li>
</ol>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/750.png" alt></p>
<p><strong>各种尺寸启动图图标生成</strong></p>
<blockquote>
<p>启动图也可以使用图标工厂生产了 <a href="https://icon.wuruihong.com/splash" target="_blank" rel="noopener">https://icon.wuruihong.com/splash</a></p>
</blockquote>
<ol>
<li>安卓下拷贝生成的文件到<code>andriod/app/src/main/res/</code>目录下</li>
</ol>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/751.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/750.png" alt></p>
<ol start="2">
<li>iOS下拷贝生成的该文件夹替换即可</li>
</ol>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/752.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/753.png" alt></p>
<h2 id="安卓端"><a href="#安卓端" class="headerlink" title="安卓端"></a>安卓端</h2><p><strong>修改图标和名称</strong></p>
<blockquote>
<p>找到根目录<code>/android/app/src/main/res</code></p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/540.png" alt></p>
<p><strong>启动页</strong></p>
<blockquote>
<ul>
<li>在<code>react-native</code>的<code>android</code>中的启动图和<code>IOS</code>不相同点在于，<code>android</code>没有默认的启动图，在<code>IOS</code>里面有</li>
<li>使用插件 <code>import SplashScreen from &#39;react-native-splash-screen&#39;;</code></li>
<li><a href="https://github.com/crazycodeboy/react-native-splash-screen" target="_blank" rel="noopener">https://github.com/crazycodeboy/react-native-splash-screen</a></li>
</ul>
</blockquote>
<blockquote>
<p>把生成好的启动页按这个格式处理即可</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/541.png" alt></p>
<h2 id="iOS端"><a href="#iOS端" class="headerlink" title="iOS端"></a>iOS端</h2><p><strong>修改app名称</strong></p>
<blockquote>
<p>编辑 <code>ios/test/Info.plist</code> 文件</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;key&gt;CFBundleDisplayName&lt;/key&gt;</span><br><span class="line">- &lt;string&gt;$(PRODUCT_NAME)&lt;/string&gt;</span><br><span class="line">+ &lt;string&gt;测试程序&lt;/string&gt;</span><br></pre></td></tr></table></figure>
<p><strong>修改应用图标</strong></p>
<blockquote>
<p>应用图标对尺寸有要求，比较简单地方式是准备一张 <code>1024*1024</code> 的图片，然后使用<a href="https://icon.wuruihong.com/" target="_blank" rel="noopener">图标工厂</a>在线生成 </p>
</blockquote>
<blockquote>
<p>这里直接从 Sketch iOS 图标设计模板中选取了一张图片，生成后的结果如下</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/744.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/745.png" alt></p>
<blockquote>
<p>我们可以直接用生成好的内容替换默认的图标即可</p>
</blockquote>
<blockquote>
<p>替换 <code>ios/test/Images.xcassets/AppIcon.appiconset</code> 中的内容。如果不需要全部尺寸，可以用 XCode 打开项目，点击 <code>Images.xcassets&gt;AppIcon</code> 拖入相应尺寸的图标</p>
</blockquote>
<h2 id="添加启动页"><a href="#添加启动页" class="headerlink" title="添加启动页"></a>添加启动页</h2><blockquote>
<p>添加启动页可以使用 <a href="https://github.com/crazycodeboy/react-native-splash-screen" target="_blank" rel="noopener">react-native-splash-screen</a> 库，通过它可以控制启动页的显示和隐藏</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">$ yarn add react-native-splash-screen</span><br><span class="line"></span><br><span class="line">$ react-native link react-native-splash-screen</span><br></pre></td></tr></table></figure>
<p><strong>Android</strong></p>
<blockquote>
<p>编辑 <code>MainActivity.java</code>，添加显示启动页的代码</p>
</blockquote>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> android.os.Bundle; <span class="comment">// here</span></span><br><span class="line"><span class="keyword">import</span> com.facebook.react.ReactActivity;</span><br><span class="line"><span class="comment">// react-native-splash-screen &gt;= 0.3.1</span></span><br><span class="line"><span class="keyword">import</span> org.devio.rn.splashscreen.SplashScreen; <span class="comment">// here</span></span><br><span class="line"><span class="comment">// react-native-splash-screen &lt; 0.3.1</span></span><br><span class="line"><span class="keyword">import</span> com.cboy.rn.splashscreen.SplashScreen; <span class="comment">// here</span></span><br><span class="line"></span><br><span class="line">public <span class="class"><span class="keyword">class</span> <span class="title">MainActivity</span> <span class="keyword">extends</span> <span class="title">ReactActivity</span> </span>&#123;</span><br><span class="line">   @Override</span><br><span class="line">    protected <span class="keyword">void</span> onCreate(Bundle savedInstanceState) &#123;</span><br><span class="line">        SplashScreen.show(<span class="keyword">this</span>);  <span class="comment">// here</span></span><br><span class="line">        <span class="keyword">super</span>.onCreate(savedInstanceState);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">// ...other code</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<blockquote>
<p>在 <code>android/app/src/main/res/layout</code> 文件夹下创建启动页布局文件 <code>launch_screen.xml</code></p>
</blockquote>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="meta">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">LinearLayout</span> <span class="attr">xmlns:android</span>=<span class="string">"http://schemas.android.com/apk/res/android"</span></span></span><br><span class="line"><span class="tag">    <span class="attr">android:orientation</span>=<span class="string">"vertical"</span> <span class="attr">android:layout_width</span>=<span class="string">"match_parent"</span></span></span><br><span class="line"><span class="tag">    <span class="attr">android:layout_height</span>=<span class="string">"match_parent"</span></span></span><br><span class="line"><span class="tag">    <span class="attr">android:background</span>=<span class="string">"@drawable/launch_image"</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">LinearLayout</span>&gt;</span></span><br></pre></td></tr></table></figure>
<blockquote>
<p>将启动页图片放置在 <code>drawable</code> 文件夹下</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">drawable-ldpi</span><br><span class="line">drawable-mdpi</span><br><span class="line">drawable-hdpi</span><br><span class="line">drawable-xhdpi</span><br><span class="line">drawable-xxhdpi</span><br><span class="line">drawable-xxxhdpi</span><br></pre></td></tr></table></figure>
<ul>
<li>Android 会自动缩放 drawable 下的图片，所以我们不必为所有分辨率的设备准备启动图</li>
<li>完成上述操作后，重新打包应用，再启动时就可以看到启动页了。不过，启动页显示之前会有短暂的白屏，我们可以通过设置透明背景来处理。编辑 <code>android/app/src/main/res/values/styles.xml</code> 文件，修改如下</li>
</ul>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">resources</span>&gt;</span></span><br><span class="line">    <span class="comment">&lt;!-- Base application theme. --&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">style</span> <span class="attr">name</span>=<span class="string">"AppTheme"</span> <span class="attr">parent</span>=<span class="string">"Theme.AppCompat.Light.NoActionBar"</span>&gt;</span></span><br><span class="line"><span class="xml">        <span class="comment">&lt;!-- Customize your theme here. --&gt;</span></span></span><br><span class="line"><span class="xml">+        <span class="tag">&lt;<span class="name">item</span> <span class="attr">name</span>=<span class="string">"android:windowIsTranslucent"</span>&gt;</span>true<span class="tag">&lt;/<span class="name">item</span>&gt;</span></span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">style</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">resources</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p><strong>iOS</strong></p>
<blockquote>
<p><a href="https://github.com/phodal/growth/tree/master/ios/growth/Images.xcassets/AppIcon.appiconset" target="_blank" rel="noopener">图标配置参考</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">#import "AppDelegate.h"</span><br><span class="line"></span><br><span class="line">#import &lt;React/RCTBundleURLProvider.h&gt;</span><br><span class="line">#import &lt;React/RCTRootView.h&gt;</span><br><span class="line">#import "RNSplashScreen.h"  // here</span><br><span class="line"></span><br><span class="line">@implementation AppDelegate</span><br><span class="line"></span><br><span class="line">- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions</span><br><span class="line">&#123;</span><br><span class="line">    <span class="comment">// ...other code</span></span><br><span class="line"></span><br><span class="line">    [RNSplashScreen show];  <span class="comment">// here</span></span><br><span class="line">    <span class="keyword">return</span> YES;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">@end</span><br></pre></td></tr></table></figure>
<blockquote>
<p>用 XCode 打开项目，选中 <code>LaunchScreen.xib</code> 中的 <code>View</code>，取消选中 <code>Use Launch Screen</code></p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/746.webp" alt></p>
<blockquote>
<p>选中项目，在 <code>General</code> 配置中设置 <code>Launch Images Srouce</code>，点击 <code>Use Asset Catalog</code>，弹出对话框中使用默认即可（此操作会在 <code>Images.xcassets</code> 中创建 <code>LaunchImage</code>），然后设置 <code>Launch Screen File</code> 为空</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/747.webp" alt></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/754.png" alt></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/755.png" alt></p>
<blockquote>
<p>点击 <code>Images.xcassets &gt; LaunchImage</code>，在右侧属性栏处选择要支持的设备。接着，添加对应分辨率的图片，分辨率对照如下</p>
</blockquote>
<table>
<thead>
<tr>
<th>设备</th>
<th>分辨率</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>iOS 11+</code></td>
<td><code>1125*2436</code></td>
</tr>
<tr>
<td><code>iOS 8+ Retina HD 5.5</code></td>
<td><code>1242*2208</code></td>
</tr>
<tr>
<td><code>iOS 8+ Retina HD 4.7</code></td>
<td><code>750*1334</code></td>
</tr>
<tr>
<td><code>iOS 7+ 2x</code></td>
<td><code>640*960</code></td>
</tr>
<tr>
<td><code>iOS 7+ Retina 4</code></td>
<td><code>640*1136</code></td>
</tr>
<tr>
<td><code>iOS 5,6 1x</code></td>
<td><code>320*480</code></td>
</tr>
<tr>
<td><code>iOS 5,6 2x</code></td>
<td><code>640*960</code></td>
</tr>
<tr>
<td><code>iOS 5,6 Retina 4</code></td>
<td><code>640*1136</code></td>
</tr>
</tbody>
</table>
<p><strong>安卓的尺寸</strong></p>
<table>
<thead>
<tr>
<th>设备</th>
<th>分辨率</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>mdpi:</code></td>
<td><code>375*667</code></td>
</tr>
<tr>
<td><code>hdpi:</code></td>
<td><code>563*1001</code></td>
</tr>
<tr>
<td><code>xhdpi:</code></td>
<td><code>750*1334</code></td>
</tr>
<tr>
<td><code>xxhdpi:</code></td>
<td><code>1125*2001</code></td>
</tr>
<tr>
<td><code>xxxhdpi:</code></td>
<td><code>1500*2668</code></td>
</tr>
</tbody>
</table>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/748.webp" alt></p>
<p>完成上述操作之后，重新安装 APP 再启动时就可以看到启动页</p>

      </div>
    
  </div>

</article>

<button class="assist-btn2 circle" id="assist_btn2" title="点亮屏幕" style="left: 27px; top: 152px;">
  <i class="iconfont" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>
<button class="assist-btn1 circle" id="assist_btn1" title="关闭屏幕亮度" style="left: 27px; top: 152px;">
  <i class="iconfont toc-title" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>


<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>	

<script src="https://my.openwrite.cn/js/readmore.js" type="text/javascript"></script>
<script>
  const btw = new BTWPlugin();
  btw.init({
    id: "container",
    blogId: "22699-1592137983091-414",
    name: "前端进阶之旅",
    qrcode: "https://poetries1.gitee.io/img-repo/2020/06/qrcode.jpg",
    keyword: "3a3b3c",
  });
</script>

<script type="text/javascript">

// white theme
var body = {color: "#555", background: "#000"};
var a_tag = {color: "#222"};
var header = { background: "#222"};
var logo_line_i = {background: "#222"};
// var post_code = {background: "#eee", color: "#222"};

function switch_theme() {
 $("body").css(body);
 $("a:not('.links-of-author-item a, .site-state-item a, .site-state-posts a, .feed-link a, .motion-element a, .post-tags a, .show-commit-cls a, #donate_board a')").css(a_tag);
 $(".header, .footer").css(header);
 $(".logo-line-before i, .logo-line-after i").css(logo_line_i);
 //$(".post code").css(post_code);
 $("#idhyt-surprise-ball #idhyt-surprise-ball-animation .drag").css(a_tag);
 $(".post-title-link, .posts-expand .post-meta, .post-comments-count, .disqus-comment-count, .post-category a, .post-nav-next a, .post-nav-item a").css(a_tag);
 
 // $("code").css({color: '#c5c8c6', background: '#1d1f21'});
 //$("#assist_btn1").hide(1500);
}

$(function () {
$("#assist_btn2").css("display","none");
 $("#assist_btn1").click(function() {
     switch_theme();
$("div#toc.toc-article").css({
 "background":"#eaeaea",
 "opacity":1
});
$(".toc-article ol").show();
$("#toc.toc-article .toc-title").css("color","#a98602");
$("#assist_btn1").css("display","none");
$("#assist_btn2").css("display","block");
 });
$("#assist_btn2").click(function() {
$("#assist_btn2").css("display","none");
$("#assist_btn1").css("display","block");
$("body").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
     $(".header, .footer").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
$(".toc-article ol").toggle(1000);
 });
});


//背景随机

var Y, O, E, L, B, C, T, z, N, S, A, I;
!function() {
var e = function() {
for (O.clearRect(0, 0, L, B), T = [{
x: 0,
y: .7 * B + C
}, {
x: 0,
y: .7 * B - C
}]; T[1].x < L + C;) t(T[0], T[1])
}, t = function(e, t) {
O.beginPath(), O.moveTo(e.x, e.y), O.lineTo(t.x, t.y);
var n = t.x + (2 * I() - .25) * C,
 r = a(t.y);
O.lineTo(n, r), O.closePath(), N -= S / -50, O.fillStyle = "#" + (127 * A(N) + 128 << 16 | 127 * A(N + S / 3) + 128 << 8 | 127 * A(N + S / 3 * 2) + 128).toString(16), O.fill(), T[0] = T[1], T[1] = {
 x: n,
 y: r
}
}, a = function n(e) {
var t = e + (2 * I() - 1.1) * C;
return t > B || t < 0 ? n(e) : t
};
Y = document.getElementById("evanyou"), O = Y.getContext("2d"), E = window.devicePixelRatio || 1, L = window.innerWidth, B = window.innerHeight, C = 90, z = Math, N = 0, S = 2 * z.PI, A = z.cos, I = z.random, Y.width = L * E, Y.height = B * E, O.scale(E, E), O.globalAlpha = .6, document.onclick = e, document.ontouchstart = e, e()
}()

   
$("#toc-eye").click(function(){
$("#toc.toc-article").toggle(1000);
});

</script>


   
  <div class="text-center donation">
    <div class="inner-donation">
      <span class="btn-donation">支持一下</span>
      <div class="donation-body">
        <div class="tip text-center">扫一扫，支持poetries</div>
        <ul>
        
          <li class="item">
            
              <span>微信扫一扫</span>
            
            <img src="/images/weixin.jpg" alt="">
          </li>
        
          <li class="item">
            
              <span>支付宝扫一扫</span>
            
            <img src="/images/zhifubao.jpg" alt="">
          </li>
        
        </ul>
      </div>
    </div>
  </div>


   
  <div class="box-prev-next clearfix">
    <a class="show pull-left" href="/2019/10/03/rn-ios-distribute/">
        <i class="icon icon-angle-left"></i>
    </a>
    <a class="show pull-right" href="/2019/10/06/vue-review/">
        <i class="icon icon-angle-right"></i>
    </a>
  </div>




</div>


  <a id="backTop" class="back-top">
    <i class="icon-angle-up"></i>
  </a>




  <div class="modal" id="modal">
  <span id="cover" class="cover hide"></span>
  <div id="modal-dialog" class="modal-dialog hide-dialog">
    <div class="modal-header">
      <span id="close" class="btn-close">关闭</span>
    </div>
    <hr>
    <div class="modal-body">
      <ul class="list-toolbox">
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/archives/"
              rel="noopener noreferrer"
              target="_self"
              >
              博客
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/categories/"
              rel="noopener noreferrer"
              target="_self"
              >
              分类
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/tags/"
              rel="noopener noreferrer"
              target="_self"
              >
              标签
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/search/"
              rel="noopener noreferrer"
              target="_self"
              >
              搜索
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/link/"
              rel="noopener noreferrer"
              target="_self"
              >
              友链
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/about/"
              rel="noopener noreferrer"
              target="_self"
              >
              关于
            </a>
          </li>
        
      </ul>

    </div>
  </div>
</div>



  
      <div class="fexo-comments comments-post">
    

    

    
    

    

    
    

    

<!-- Gitalk评论插件通用代码 -->
<div id="gitalk-container"></div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
  clientID: '5567a2c4abb858009d96',
  clientSecret: 'b9039ec056cf5c2346b3cdb63308a28c163f91e5',
  repo: 'poetries.github.io',
  owner: 'poetries',
  // 在这里设置一下截取前50个字符串, 这是因为 github 对 label 的长度有了要求, 如果超过
  // 50个字符串则会报错.
  // id: location.pathname.split('/').pop().substring(0, 49),
  id: location.pathname,
  admin: ['poetries'],
  // facebook-like distraction free mode
  distractionFreeMode: false
})
gitalk.render('gitalk-container')
</script>
<!-- Gitalk代码结束 -->



  </div>

  

  <script type="text/javascript">
  function loadScript(url, callback) {
    var script = document.createElement('script')
    script.type = 'text/javascript';

    if (script.readyState) { //IE
      script.onreadystatechange = function() {
        if (script.readyState == 'loaded' ||
          script.readyState == 'complete') {
          script.onreadystatechange = null;
          callback();
        }
      };
    } else { //Others
      script.onload = function() {
        callback();
      };
    }

    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);
  }

  window.onload = function() {
    loadScript('/js/bundle.js?235683', function() {
      // load success
    });
  }
</script>


  <!-- 页面点击小红心 -->
  <script type="text/javascript" src="/js/clicklove.js"></script>
 
  
</body>
</html>
